package com.mdlib.helper.module.location;

import android.text.TextUtils;

import java.io.Serializable;

/**
 * Created by librabin on 16/12/16.
 */

public class AddressEntity implements Serializable {

    private double latitude;

    private double longitude;

    private String name;

    private String district;

    private String adcode;

    private String extraAddr;

    private String detailAddress;


    public AddressEntity(double latitude, double longitude, String name, String district, String adcode) {
        this.latitude = latitude;
        this.longitude = longitude;
        this.name = name;
        this.district = district;
        this.adcode = adcode;
    }


    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getAdcode() {
        return adcode;
    }

    public void setAdcode(String adcode) {
        this.adcode = adcode;
    }

    public String getExtraAddr() {
        return extraAddr;
    }

    public void setExtraAddr(String extraAddr) {
        this.extraAddr = extraAddr;
    }


    public String getDetailAddress() {
        if (TextUtils.isEmpty(name)) {
            return detailAddress;
        }
        return district + name;
    }

    public void setDetailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
    }
}
